<% include file="header.html" %>
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<script type="text/javascript">
				$(document).ready(function(){
					$("#callotherkws").click(function(){
						 $.getJSON(
									"?do=launch.searchArticles",
									{
										keywords:$("#keywords").val()
									},
									function(data){
										$("#articlenum").val(data['articlenum']);
									}                         
								 );
					})
				});
			</script>
			
			<!-- Page Head -->
			<h2>Keyword广告</h2><p class="clear"></p>
			
			
			<ul class="shortcut-buttons-set" style="display:none;">
				
				<li><a class="shortcut-button" href="#"><span>
					<img src="images/icons/pencil_48.png" alt="icon" /><br />
					Write an Article
				</span></a></li>
				
				<li><a class="shortcut-button" href="#"><span>
					<img src="images/icons/paper_content_pencil_48.png" alt="icon" /><br />
					Create a New Page
				</span></a></li>
				
				<li><a class="shortcut-button" href="#"><span>
					<img src="images/icons/image_add_48.png" alt="icon" /><br />
					Upload an Image
				</span></a></li>
				
				<li><a class="shortcut-button" href="#"><span>
					<img src="images/icons/clock_48.png" alt="icon" /><br />
					Add an Event
				</span></a></li>
				
				<li><a class="shortcut-button" href="#messages" rel="modal"><span>
					<img src="images/icons/comment_48.png" alt="icon" /><br />
					Open Modal
				</span></a></li>
				
			</ul><!-- End .shortcut-buttons-set -->
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>完善投放</h3>
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
					<div class="tab-content default-tab font_14" id="tab2">
						<div class="notification attention png_bg">
                            <a href="#" class="close"><img src="images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                            <div>当前操作的提示以及警告信息！</div>
                
						</div>
						<form action="#" method="post" id="myform">
							
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<input type="hidden" value="<%$obj->id%>" name="id" />
								<p><div class="row_name">创意名称：</div><input class="text-input little-input" type="text" name="name" id="name" value="<% $obj->name %>" /> <!-- Classes for input-notification: success, error, information, attention -->&nbsp;&nbsp;&nbsp;&nbsp;所属投放：<input class="text-input little-input" type="text" name="launchname"  value="<% $obj->launch_name %>" /> <!-- Classes for input-notification: success, error, information, attention --></p>
                                <p><div class="row_name">投放时间：</div><input class="text-input little-input" type="text" name="start" id="start" value="<% $obj->start %>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:00:00'})" /> <!-- Classes for input-notification: success, error, information, attention -->&nbsp;&nbsp;至&nbsp;&nbsp;<input class="text-input little-input" type="text" name="end" id="end" value="<% $obj->end %>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:00:00'})" /> <!-- Classes for input-notification: success, error, information, attention --></p>
                                <p>
                                	<div class="row_name">设置权重：</div>
                                	<input class="text-input little-input" type="text" name="weight" id="weight" value="<% $obj->weight %>"/> <!-- Classes for input-notification: success, error, information, attention -->
                                	<span class="gray" style="font-size:12px; margin-left:6px;">支持整数，数字越大权重越大。如其他条件相同则权重大的广告优先投放,此为避免投放之间的竞争关系.</span>
                                </p>
                                <p><div class="row_name">订单：</div><input class="text-input little-input" type="text" name="order" id="order" value="<% $obj->order %>"/> <!-- Classes for input-notification: success, error, information, attention --></p>
                                <p><div class="row_name">广告主：</div><input class="text-input little-input" type="text" name="activity" id="activity" value="<% $obj->activity %>"/> <!-- Classes for input-notification: success, error, information, attention --></p>
								<input type="hidden" name="clickurl" value="<% $obj->click_url %>" />
								<input type="hidden" name="size" value="<% $obj->size %>" />
								<input type="hidden" name="status" value="<% $obj->status %>" />
								<input type="hidden" name="window" value="<% $obj->target_window %>" />
								<input type="hidden" name="a" value="<% $a %>" />
								<script>
									function senddata(inputobj){
									var str="正在扩词：";
									var str1="...";
									var obj;
									obj=document.getElementById("outdiv");
									obj.innerHTML=str+inputobj.value+str1;
									}
								</script>
								<p>
									<div class="row_name">关 键 词：</div>
									<input class="text-input medium-input" style="width: 20%; width: 20% !important" type="text" name="keywords" id="keywords" value="<% $obj->keywords %>" />&nbsp;&nbsp;&nbsp;
									<a href="#" class="underline" >导入</a>
									<input id="callotherkws" class="button" type="button" value="搜索" style="margin-left:24px;" onclick="javascript:senddata(keywords);"/>
									<br />
									<span class="gray" style="margin-left:6px; font-size:12px;">输入关键词，清用英文逗号分割多个关键词</span>
									<div id="outdiv" class="gray" style=" margin:5px 0 0 80px; font-size:12px;"></div><!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<p><div class="row_name" style="text-align:left; line-height:20px; margin-top:-8px; width:78px; margin-left:-4px;">匹配到的文章数：</div><input class="text-input little-input" type="text" name="articlenum"  id="articlenum" value=""  readonly="readonly" /></p>
								
								<!-- 隐藏掉，暂时不显示匹配文章信息
								<p>
									<label>匹配到的文章数</label>
                                    <div class="display_frame">
                                    	<p>搜索结果：</p>
                                        <div class="keyword_search">
                                            <p>关键词一</p>
                                            <p>GUCCI</p>
                                            <p>搜索结果</p>
                                            <p>1304项</p>
                                            <p>匹配到的广告位</p>
                                            <p>50项</p>
                                            <div>详细列表：</div>
                                        </div>
                                        <div class="keyword_search">
                                            <p>关键词二</p>
                                            <p>GUCCI香水</p>
                                            <p>搜索结果</p>
                                            <p>356项</p>
                                            <p>匹配到的广告位</p>
                                            <p>33项</p>
                                            <div>详细列表：</div>
                                        </div>
                                        <div class="keyword_search">
                                            <p>关键词二</p>
                                            <p>GUCCI饰品</p>
                                            <p>搜索结果</p>
                                            <p>354项</p>
                                            <p>匹配到的广告位</p>
                                            <p>23项</p>
                                            <div>详细列表：</div>
                                        </div>
                                    </div>
								</p>
								 -->
								
								<p><div class="row_name">投放量：</div><input class="text-input little-input" type="text" name="num" id="num" value="<% $obj->num %>"  /> <!-- Classes for input-notification: success, error, information, attention --></p>
								
                                <p>
                                	<div class="row_name" style="clear:both;"> 投放样式：</div>
                                </p>
								
								<div class="brand_style" style="clear:both; margin-left:66px;">
                                    <div class="brand_r" style="width:auto;">
                                    	<% if $isHDID==true %>
                                    	<!-- <script type="text/javascript" src="/uploadify/jquery-1.4.2.min.js"></script>  -->
										<script type="text/javascript" src="uploadify/swfobject.js"></script>
										<script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
										<script type="text/javascript">
										// <![CDATA[
										$(document).ready(function() {
										  $('#file_upload').uploadify({
										    'uploader'  : 'uploadify/uploadify.swf',
										    'script'    : 'uploadify/uploadify.php',
										    'cancelImg' : 'uploadify/cancel.png',
										    'folder'    : 'upload_file/image',
										    'auto'      : true,
										    'buttonText': 'upload file',
										    'onComplete'  : function(event, ID, fileObj, response, data) {
										        $("#img").val(response);
										     }
										  });
										});
										// ]]>
										</script>
										<div style="clear:both; line-height:40px;">
											选择广告样式：
											<select name="tpl" id="tpl">
												<option value="0" <% if $obj->tpl==0 %>selected=true<% /if %>>原有样式</option>
												<option value="1" <% if $obj->tpl==1 %>selected=true<% /if %>>新增样式</option>
											</select>
										</div>
                                    	<div style="clear:both; line-height:40px;">
                                    		<div style="line-height:32px; float:left;">图片：</div>
                                    		<input id="file_upload" type="file" name="file_upload" value="<% $imgInfo->img %>" class="text-input" style="width:174px;"/>
                                    		图片的尺寸：<span class="gray" style="font-size:12px; margin-left:6px;">72 X112</span>
                                    	</div>
                                    	<div style="clear:both; line-height:40px;">标题：<input type="text" style="width:174px;" id="img_title" name="img_title" value="<% $imgInfo->img_title %>"  class="text-input"/></div>
                                    	<div style="clear:both; line-height:40px;">内容：<input type="text" id="img_desc" style="width:227px;" name="img_desc" value="<% $imgInfo->img_desc %>"  class="text-input" onkeydown="javascript:checkKWcontentLength();" onkeyup="javascript:checkKWcontentLength();" /><span id="inputNumber"></span></div>
	                                    <div style="clear:both; line-height:40px;">跳转链接：<input type="text" id="img_outurl" name="img_outurl" style="width:227px;" value="<% $imgInfo->img_outurl %>" class="text-input" /></div>
	                                    <div style="clear:both; line-height:40px;">价格(￥)：<input type="text" id="img_price" style="width:174px" name="img_price" value="<% $imgInfo->img_price %>"  class="text-input"/></div>
                                		<% else %>
                                    	<p>预览：</p>
                                		<iframe src="<%$cloud_host%>d/preview.php?id=<% $obj->id %>" style="height: 500px; width: 500px;" ></iframe>
                                		<%/if%>
                                		<input type="hidden" name="img" id="img" value="<% $img %>"  />
                                    </div>
								</div>
								 
								
								<p>
									<% if $isHDID==true %>
									<input class="button" type="button" value="预览"  onclick="javascript:previewofkwinsert()" style="margin-left:74px;" />
									<%/if%>
									<% if $op=='add' %>
									<input type="hidden" name="adid" value="<% $obj->id %>" />
									<input class="button" type="submit" value="完成"  onclick="fromsubmit('kws','add')" style="margin-left:40px;" />
									<%elseif $op=='add_self'%>
									<input class="button" type="submit" value="完成"  onclick="fromsubmit('kws','add_self')" style="margin-left:40px;" />
									<%else%>
									<input class="button" type="submit" value="完成"  onclick="fromsubmit('kws','modify')" style="margin-left:40px;" />
									<%/if%>
								</p>
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
						
					</div> <!-- End #tab2 -->        
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			<div id="dialog-modal" title="preview">
			<div class="clear"></div>
			
<% include file="footer.html" %>